package glossos.tree;

import com.google.common.base.Function;

class NodeToSequenceFunction implements Function<Node, String> {

	private Node startingNode;
	
	public NodeToSequenceFunction() {}
	
	public NodeToSequenceFunction(Node startingNode) {
		this.startingNode = startingNode;
	}

	public String apply(Node node) {
		if (startingNode == null)
			return node.sequence();
		else
			return node.sequenceTail(startingNode);
	}

}
